{include file='Public/header' /}
<div class="layui-layout layui-layout-admin">
{include file='Public/head' /}	
{include file='Public/side' /}	
	<div class="layui-body"> 
{include file='Public/crumbs' /}
		<!-- 内容主体区域 -->
		<div class="shu-body shu-setting">
			<div class="layui-fluid">
				<form class="layui-form layui-form-pane" action="" method="post">
				<div class="layui-form-item">
				  	<label class="layui-form-label">用户名</label>
				  	<div class="layui-input-inline">
					<input type="text" disabled="disabled" value="{$member.user}" required lay-verify="required" autocomplete="off" class="layui-input">
				  	</div>
					<div class="layui-form-mid layui-word-aux">无法修改</div>
				</div>
				<div class="layui-form-item">
				  	<label class="layui-form-label">用户密码</label>
				  	<div class="layui-input-inline">
					<input type="password" name="password" id="password" placeholder="用户密码" value="" class="layui-input">
				  	</div>
					<div class="layui-form-mid layui-word-aux">留空不修改</div>
				</div>
				<div class="layui-form-item">
				  	<label class="layui-form-label" style="height:100px; line-height:80px;">头像</label>
				  	<div class="layui-input-inline">
						{notempty name='member'}
						{:UpImage("head",100,100,$member['head'])}
						{else /}
						{:UpImage("head",100,100,null)}
						{/notempty}
				  	</div>
					<div class="layui-form-mid layui-word-aux" style="line-height:80px">仅支持jpg、gif、png、bmp、jpeg，且小于1MB。</div>
				</div>
				
				
				<div class="layui-form-item">
				  	<label class="layui-form-label">性别</label>
				  	<div class="layui-input-inline">
                                    <select id="sex" name="sex" class="multiselect">
                                        <option value="0"
                                        {if condition="$member['sex'] eq 0"}selected="selected"{/if}
                                        >保密</option>
                                        <option value="1"
                                        {if condition="$member['sex'] eq 1"}selected="selected"{/if}
                                        >男</option>
                                        <option value="2"
                                        {if condition="$member['sex'] eq 2"}selected="selected"{/if}
                                        >女</option>
                                    </select>
				  	</div>
					<div class="layui-form-mid layui-word-aux"></div>
				</div>
				<div class="layui-form-item">
				  	<label class="layui-form-label">生日</label>
				  	<div class="layui-input-block">
					<input id="birthday" name="birthday" value="{$member['birthday']|date=" Y-m-d",###}" type="text" class="layui-input">
				  	</div>
				</div>
				<div class="layui-form-item">
				  	<label class="layui-form-label">电话号码</label>
				  	<div class="layui-input-inline">
					<input  name="phone" id="phone" placeholder="电话号码" value="{$member['phone']}" type="text" class="layui-input">
				  	</div>
				</div>
				<div class="layui-form-item">
				  	<label class="layui-form-label">QQ</label>
				  	<div class="layui-input-inline">
					<input  name="qq" id="qq" placeholder="QQ" value="{$member['qq']}" type="text" class="layui-input">
				  	</div>
				</div>
				<div class="layui-form-item">
				  	<label class="layui-form-label">E-mail</label>
				  	<div class="layui-input-inline">
					<input name="email" id="email" placeholder="E-mail" value="{$member['email']}" type="text" class="layui-input">
				  	</div>
				</div>
				
				
				<div class="layui-form-item">
				  <div class="layui-input-block">
					<button class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				  </div>
				</div>
			  </form>
			</div>
		</div>
		<!-- 内容主体区域 END-->
	</div>
{include file='Public/footer' /}	
<script>
layui.use(['form','laydate'], function(){
	var form = layui.form,jq = layui.$,laydate=layui.laydate;
	form.on('submit(formDemo)', function(data){
		loading = layer.load(2, {
			shade: [0.2,'#000']
		});
		var param = data.field;
		jq.post("{:url('update')}",param,function(data){
			//console.log(data);
			if(data.code == 1){
				layer.close(loading);
				layer.msg(data.msg, {icon: 1, time: 1000}, function(){
					location.reload();
					//location.href="{:url('index')}";
				});
			}else{
				layer.close(loading);
				layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
			}
		});
	return false;
	});
	
	//日期
	laydate.render({
    	elem: '#birthday' //指定元素
  	});
	
	
	
});
</script>